/*
 * @Author: your name
 * @Date: 2021-04-20 08:10:36
 * @LastEditTime: 2021-04-21 14:10:51
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: \新建文件夹\the-third-group\app\src\mock\mock.js
 */
import Mock from 'mockjs'

Mock.mock("/api/getdata",()=>{
    return Mock.mock({
        "actorlist|3":[{
            'serial|+1':1,
            "id":'text @increment(1)',
            name: '@cname',
            hospital:'@ctitle(5,9)',
            grade:'主治医师',
            phone:'@integer(10000000000,19999999999)',
            pass:"@integer(100000,999999)"
          }],
          "sicklist|3":[{
            'serial|+1':1,
            "id":'text @increment(1)',
            name: '@cname',
            phone:'@integer(10000000000,19999999999)',
            pass:"@integer(100000,999999)"
          }]
    })
})

const data=Mock.mock({
  'audit|20':[
      {
          name:'@cname',
          subjection:'@ctitle(4)',
          technical:'主治医师',
          'agelimit|5-10':5,
          qualification:'已上传',
          practice:'已上传',
          idcard:'已上传',
          'type|1-3':1
      }
  ]
})

Mock.mock('/api/audit',"post",(req)=>{
  const {pageIndex,pageSize}=JSON.parse(req.body);
  console.log(req,data,pageIndex,pageSize);
  const arr=data.audit.slice((pageIndex-1)*pageSize,pageIndex*pageSize)
  const total=data.audit.length
  return {
    code:200,
    data:arr,
    total:total
  }
})
// Mock.mock('/api/audit',()=>{
//   return Mock.mock({
//       'audit|10':[
//           {
//               name:'@cname',
//               subjection:'@ctitle(4)',
//               technical:'主治医师',
//               'agelimit|5-10':5,
//               qualification:'已上传',
//               practice:'已上传',
//               idcard:'已上传',
//               'type|1-3':1
//           }
//       ]
//   })
// })

//商品列表数据
const data1=Mock.mock({
  "list|10":[
    {
      id:"@id",
      img:"@image(100x100,@color)",
      title:"@ctitle(2,4)"
    }
  ]
})

Mock.mock("/getGoods","post",(req)=>{
   const {pageIndex,pageSize}=JSON.parse(req.body)
   console.log(req,data1,pageIndex,pageSize);
   const arr=data1.list.slice((pageIndex-1)*pageSize,pageIndex*pageSize)
   return {
     data:200,
     data:arr
   }
})

//渲染患者列表
Mock.mock("/api/list",(()=>{
  return Mock.mock({
      "renderList|3":[
          {
              'serial|+1':"1",
              id:"text @increment(1)",
              name: "@cname",
              tel:"@integer(1000000000,9999999999)",
              "age|10-99":11,
              'number|10-20':12,
              'money|100-300':200,
              handle:"详情"
          }
      ]
  })
}))

//渲染详情列表
Mock.mock("/api/lis",(()=>{
  return Mock.mock({
      "tableData|3":[
          {
              'serial|+1':"1",
              'date':'2021-1-1',
              name: "@cname",
              "age|10-30":10,
              'money|100-300':200,
              "illness":"胃病",
              ming:"@cname",
              job:"@ctitle(4)",
              tel:"@integer(1000000000,9999999999)",
              hospital:"@ctitle(2)医院",
              handle:"详情"
          }
      ]
  })
}))


